package cn.admin.configcenter.configservice.util;

public class StringUtils {

	public static boolean equals(String str1, String str2) {
		return str1 == null ? str2 == null : str1.equals(str2);
	}

	public static boolean isBlank(String str) {
		int strLen;
		if (str != null && (strLen = str.length()) != 0) {
			for (int i = 0; i < strLen; ++i) {
				if (!Character.isWhitespace(str.charAt(i))) {
					return false;
				}
			}

			return true;
		} else {
			return true;
		}
	}

	public static String likeSupport(String s) {
		if (isBlank(s)) {
			return "*";
		} else {
			if (!s.startsWith("*")) {
				s = "*" + s;
			}

			if (!s.endsWith("*")) {
				s = s + "*";
			}

			return s;
		}
	}

}
